From 93a7173714a501a1587a999a76fd717c0aa3684c Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 21 Dec 2005 19:10:53 +0100 Subject: [PATCH] Remove obsolete MMUEXT_REASSIGN_PAGE. It's not used by anyone and is superceded by grant transfers. Signed-off-by: Keir Fraser --- xen/arch/x86/mm.c | 99 ---------------------------------------- xen/include/public/xen.h | 7 +-- 2 files changed, 1 insertion(+), 105 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 4baf2252c8..c306df588f 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1930,105 +1930,6 @@ int do_mmuext_op( } break; } - - case MMUEXT_REASSIGN_PAGE: - if ( unlikely(!IS_PRIV(d)) ) - { - MEM_LOG("Dom %u has no reassignment priv", d->domain_id); - okay = 0; - break; - } - - e = percpu_info[cpu].foreign; - if ( unlikely(e == NULL) ) - { - MEM_LOG("No FOREIGNDOM to reassign mfn %lx to", mfn); - okay = 0; - break; - } - - /* - * Grab both page_list locks, in order. This prevents the page from - * disappearing elsewhere while we modify the owner, and we'll need - * both locks if we're successful so that we can change lists. - */ - if ( d < e ) - { - spin_lock(&d->page_alloc_lock); - spin_lock(&e->page_alloc_lock); - } - else - { - spin_lock(&e->page_alloc_lock); - spin_lock(&d->page_alloc_lock); - } - - /* - * Check that 'e' will accept the page and has reservation - * headroom. Also, a domain mustn't have PGC_allocated pages when - * it is dying. - */ - ASSERT(e->tot_pages <= e->max_pages); - if ( unlikely(test_bit(_DOMF_dying, &e->domain_flags)) || - unlikely(e->tot_pages == e->max_pages) || - unlikely(IS_XEN_HEAP_FRAME(page)) ) - { - MEM_LOG("Transferee has no reservation headroom (%d,%d), or " - "page is in Xen heap (%lx), or dom is dying (%ld).", - e->tot_pages, e->max_pages, mfn, e->domain_flags); - okay = 0; - goto reassign_fail; - } - - /* - * The tricky bit: atomically change owner while there is just one - * benign reference to the page (PGC_allocated). If that reference - * disappears then the deallocation routine will safely spin. - */ - _d = pickle_domptr(d); - _nd = page->u.inuse._domain; - y = page->count_info; - do { - x = y; - if ( unlikely((x & (PGC_count_mask|PGC_allocated)) != - (1|PGC_allocated)) || - unlikely(_nd != _d) ) - { - MEM_LOG("Bad page values %lx: ed=%p(%u), sd=%p," - " caf=%08x, taf=%" PRtype_info, - page_to_pfn(page), d, d->domain_id, - unpickle_domptr(_nd), x, page->u.inuse.type_info); - okay = 0; - goto reassign_fail; - } - __asm__ __volatile__( - LOCK_PREFIX "cmpxchg8b %3" - : "=d" (_nd), "=a" (y), "=c" (e), - "=m" (*(volatile u64 *)(&page->count_info)) - : "0" (_d), "1" (x), "c" (e), "b" (x) ); - } - while ( unlikely(_nd != _d) || unlikely(y != x) ); - - /* - * Unlink from 'd'. We transferred at least one reference to 'e', - * so noone else is spinning to try to delete this page from 'd'. - */ - d->tot_pages--; - list_del(&page->list); - - /* - * Add the page to 'e'. Someone may already have removed the last - * reference and want to remove the page from 'e'. However, we have - * the lock so they'll spin waiting for us. - */ - if ( unlikely(e->tot_pages++ == 0) ) - get_knownalive_domain(e); - list_add_tail(&page->list, &e->page_list); - - reassign_fail: - spin_unlock(&d->page_alloc_lock); - spin_unlock(&e->page_alloc_lock); - break; default: MEM_LOG("Invalid extended pt command 0x%x", op.cmd); diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index d07a10a877..3aa683c018 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -145,10 +145,6 @@ * cmd: MMUEXT_SET_LDT * linear_addr: Linear address of LDT base (NB. must be page-aligned). * nr_ents: Number of entries in LDT. - * - * cmd: MMUEXT_REASSIGN_PAGE - * mfn: Machine frame number to be reassigned to the FD. - * (NB. page must currently belong to the calling domain). */ #define MMUEXT_PIN_L1_TABLE 0 #define MMUEXT_PIN_L2_TABLE 1 @@ -164,14 +160,13 @@ #define MMUEXT_INVLPG_ALL 11 #define MMUEXT_FLUSH_CACHE 12 #define MMUEXT_SET_LDT 13 -#define MMUEXT_REASSIGN_PAGE 14 #define MMUEXT_NEW_USER_BASEPTR 15 #ifndef __ASSEMBLY__ struct mmuext_op { unsigned int cmd; union { - /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR, REASSIGN_PAGE */ + /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */ unsigned long mfn; /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */ unsigned long linear_addr; -- 2.30.2